/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package afroschool.beans;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author AUTRES
 */
@Entity
@Table(name = "etudiant")
@NamedQueries({@NamedQuery(name = "Etudiant.findByIdPesonne", query = "SELECT e FROM Etudiant e WHERE e.idPesonne = :idPesonne"), @NamedQuery(name = "Etudiant.findByIdAdresse", query = "SELECT e FROM Etudiant e WHERE e.idAdresse = :idAdresse"), @NamedQuery(name = "Etudiant.findByMatricule", query = "SELECT e FROM Etudiant e WHERE e.matricule = :matricule"), @NamedQuery(name = "Etudiant.findByNom", query = "SELECT e FROM Etudiant e WHERE e.nom = :nom"), @NamedQuery(name = "Etudiant.findByPrenom", query = "SELECT e FROM Etudiant e WHERE e.prenom = :prenom"), @NamedQuery(name = "Etudiant.findByGenre", query = "SELECT e FROM Etudiant e WHERE e.genre = :genre")})
public class Etudiant implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "idPesonne", nullable = false)
    private Integer idPesonne;
    @Column(name = "idAdresse")
    private Integer idAdresse;
    @Column(name = "matricule")
    private String matricule;
    @Column(name = "nom")
    private String nom;
    @Column(name = "prenom")
    private String prenom;
    @Column(name = "genre")
    private String genre;

    public Etudiant() {
    }

    public Etudiant(Integer idPesonne) {
        this.idPesonne = idPesonne;
    }

    public Integer getIdPesonne() {
        return idPesonne;
    }

    public void setIdPesonne(Integer idPesonne) {
        this.idPesonne = idPesonne;
    }

    public Integer getIdAdresse() {
        return idAdresse;
    }

    public void setIdAdresse(Integer idAdresse) {
        this.idAdresse = idAdresse;
    }

    public String getMatricule() {
        return matricule;
    }

    public void setMatricule(String matricule) {
        this.matricule = matricule;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getGenre() {
        return genre;
    }

    public void setGenre(String genre) {
        this.genre = genre;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPesonne != null ? idPesonne.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Etudiant)) {
            return false;
        }
        Etudiant other = (Etudiant) object;
        if ((this.idPesonne == null && other.idPesonne != null) || (this.idPesonne != null && !this.idPesonne.equals(other.idPesonne))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "afroschool.beans.Etudiant[idPesonne=" + idPesonne + "]";
    }

}
